package com.ztmg.water.controller.order;

import com.ztmg.common.util.resultUtils.JsonResult;;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import com.github.pagehelper.PageInfo;


import com.ztmg.water.vo.order.OrderWaterTickVO;
import com.ztmg.water.dto.order.OrderWaterTickDTO;
import com.ztmg.water.dto.order.OrderWaterTickPageDTO;
import com.ztmg.water.service.order.OrderWaterTickService;


/**
 * 
 * OrderWaterTickControllerController
 * 
 **/

@Api(description = "水票订单接口")
@RestController
@RequestMapping(value = "/orderWaterTick")
public class OrderWaterTickController{

	@Resource
	private OrderWaterTickService orderWaterTickService;

    @PostMapping("create")
    @ApiOperation("新增")
    public JsonResult create(@RequestBody OrderWaterTickDTO dto){
        return orderWaterTickService.create(dto);
    }

    @PostMapping("update")
    @ApiOperation("修改")
    public JsonResult update(@RequestBody OrderWaterTickDTO dto){
        return orderWaterTickService.update(dto);
    }

    @GetMapping("detail/{id}")
    @ApiOperation("详情")
    public JsonResult<OrderWaterTickVO> detail(@PathVariable Integer id){
        return orderWaterTickService.selectById(id);
    }

    @PostMapping("select")
    @ApiOperation("条件查询")
    public JsonResult<OrderWaterTickVO> detail(@RequestBody OrderWaterTickDTO dto){
        return orderWaterTickService.select(dto);
    }

    @PostMapping("queryPage")
    @ApiOperation("分页查询")
    public JsonResult<PageInfo<OrderWaterTickVO>> queryPage(@RequestBody OrderWaterTickPageDTO dto){
        return orderWaterTickService.selectPage(dto);
    }

    @PostMapping("delete")
    @ApiOperation("条件删除")
    public JsonResult delete(@RequestBody OrderWaterTickDTO dto){
        return orderWaterTickService.delete(dto);
    }

    @GetMapping("deleteById/{id}")
    @ApiOperation("删除")
    public JsonResult deleteById(@PathVariable Integer id){
        return orderWaterTickService.deleteById(id);
    }

}